<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<title><?php echo SEO('question-add','title');?></title>
<meta name="keywords" content="<?php echo SEO('question-add','keywords');?>">
<meta name="description" content="<?php echo SEO('question-add','description');?>">
<link href="/<?php echo C('UU_TPL_DIR');?>/public/css/question.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="/favicon.ico" />
<link href="/<?php echo C('UU_TPL_DIR');?>/public/css/common.css" rel="stylesheet" type="text/css">
<script src="/<?php echo C('UU_TPL_DIR');?>/public/js/jquery.min.js"></script>
<script src="/<?php echo C('UU_TPL_DIR');?>/public/js/jquery.dialog.js"></script>
<script src="/<?php echo C('UU_TPL_DIR');?>/public/js/common.js"></script>
<script src="/<?php echo C('UU_TPL_DIR');?>/public/js/jquery.disappear.tooltip.js"></script>
<!--[if lt IE 9]>
  <script type="text/javascript" src="/<?php echo C('UU_TPL_DIR');?>/public/js/PIE.js"></script>
  <script type="text/javascript">
    (function($){
        $.pie = function(name, v){
            // 如果没有加载 PIE 则直接终止
            if (! PIE) return false;
            // 是否 jQuery 对象或者选择器名称
            var obj = typeof name == 'object' ? name : $(name);
            // 指定运行插件的 IE 浏览器版本
            var version = 9;
            // 未指定则默认使用 ie10 以下全兼容模式
            if (typeof v != 'number' && v < 9) {
                version = v;
            }
            // 可对指定的多个 jQuery 对象进行样式兼容
            if ($.browser.msie && obj.size() > 0) {
                if ($.browser.version*1 <= version*1) {
                    obj.each(function(){
                        PIE.attach(this);
                    });
                }
            }
        }
    })(jQuery);
    if ($.browser.msie) {
      $.pie('.pie_about');
    };
  </script>
<![endif]-->
<script type="text/javascript">
var ajaxURL="<?php echo RU('ajax/view');?>";
</script>
</head>

<body>

<div class="pagetop">
		<div class="main">
          <div class="welcome link_orange" id="J_welcome">欢迎登录 <?php echo C('UU_SITE_NAME');?>！请 <span><a href="Javascript: void(0)" class="J_user_login">登录</a></span>或<span><a href="Javascript: void(0)" class="J_user_reg">注册</a></span></div>
          <div class="menu link_gray6"><a href="<?php echo C('UU_SITE_DOMAIN');?>/" class="home">网站首页</a>
		  
		  <!-- <a href="#" class="ranking">排行榜</a> <a href="#" class="category">问题分类</a> <a href="#" class="mall">积分商城</a> -->
		   
		   </div>
        	<div class="clear"></div>
        </div>
</div>

<div class="header">
  <div class="logo"><a href="/"><img src="http://www.zgxmall.com/data/upload/mall/common/05999185122820637.png"  alt="<?php echo C('UU_SITE_NAME');?>" border="0"/></a></div>
  <div class="so"></div>
  <div class="clear"></div>
</div>

<div class="pagenav">
  <div class="navmain link_white">
  <?php $tag_nav_class = new \Common\Taglib\nav();$nav = $tag_nav_class->run(array('listname'=>'nav','cache'=>'0',)); ?>
			<?php if(is_array($nav)): $i = 0; $__LIST__ = $nav;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$nav): $mod = ($i % 2 );++$i;?><div class="li  <?php if($page_as == $nav['pagealias']): ?>select<?php endif; ?>"><a href="<?php echo ($nav["url"]); ?>" target="<?php echo ($nav["target"]); ?>"><?php echo ($nav["title"]); ?></a></div><?php endforeach; endif; else: echo "" ;endif; ?>
    <div class="clear"></div>
  </div>
</div>



<div class="qadd">


  <div class="addl">
  
  <?php if($_SESSION['uu']['uid']== ''): ?><div class="logintip">
		  		<div class="txt font_yellow">&nbsp;&nbsp;&nbsp;&nbsp;已有账号？登陆后获取特权!</div>
		  <div class="txt">
				<div class="btn_green btn_inline_small btn_border J_user_login">立刻登录</div>
		  </div>
			  <div class="txt font_gray6">用第三方账号登录</div>
			  <div class="txt">
		  			<?php if(is_array($oauth_list)): $i = 0; $__LIST__ = $oauth_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$oauth): $mod = ($i % 2 );++$i;?><a class="uu_api_login_btn <?php echo ($key); ?>" href="<?php echo U('callback/index',array('mod'=>$key,'type'=>'login'));?>"></a><?php endforeach; endif; else: echo "" ;endif; ?>
					<div class="clear"></div>
			  </div>
		  <div class="clear"></div>
		</div><?php endif; ?>
	
	<form  name="add"  method="post" action="<?php echo RU('question/addsave');?>">
		
		<h2>清晰描述您的提问，可以获得更加准确的回答!</h2>
		
    <div class="inputbox zindextop">
		<input name="title" type="text" class="inputs w560"  placeholder="请在这里描述你的问题">
	  	<div class="categorysel J_cat_menu">选择问题分类</div>
		<input name="category1" id="J_category1" type="hidden" value="0">
		<input name="category2" id="J_category2" type="hidden" value="0">
		<div class="show_menu J_cat_show_menu">
		<ul>
		<?php $tag_cat_class = new \Common\Taglib\cat();$li = $tag_cat_class->run(array('listname'=>'li','type'=>'question','pid'=>'0','cache'=>'0',)); ?>
		<?php if(is_array($li["list"])): $i = 0; $__LIST__ = $li["list"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$li): $mod = ($i % 2 );++$i;?><li id="<?php echo ($li["c_id"]); ?>" title="<?php echo ($li["c_title"]); ?>"><span class="liimg"><img src="/<?php echo C('UU_IMG_CATEGORY_DIR'); echo ($li["c_pic"]); ?>" /></span><?php echo ($li["c_title"]); ?></li><?php endforeach; endif; else: echo "" ;endif; ?>
		</ul>
		</div>
	  </div>
		
		<h4>补充说明（选填）</h4>
	<div class="inputbox" >
		<textarea name="describe" cols="" rows="" class="inputs h100" placeholder="你可以继续在这里补充问题细节"></textarea>
				
					<div class="uploadbox">
							  <div class="addimg" id="J_upload_btn" name="question_img">图片</div>
							 <!-- <div class="addmap">地点</div> -->
								<div class="clear"></div>
				  </div>
				  
				   
	</div>  
	   <div class="tagdiv">
				      <div class="tagbox">
				        <div class="addtag" id="J_addtag">选择标签</div>
      					  <div class="tip">添加标签能获得快速准确的回答</div>
		              </div>
       </div>
	  <!--点击上传图片后图片出现在这里 最多上传3张,未上传下方DIV默认 display:none，非注册用户提问不允许上传图片 -->
	  
	        <div class="uploadimgbox">
		
			<div class="clear"></div>
	</div>
			
			<!--~~~~~~~~~~~~~~ -->
			
			<!--最多可选择3个标签 ,未添加下方DIV默认 display:none -->
     <div class="showtag">
				<div class="tip">你还可以添加<span>3</span>个标签</div>
				<div class="clear"></div>
    </div>


<!--如果可以获取到手机号 -->
	<?php if(($user["mobile"] != '') AND (C('UU_SMS_OPEN') == '1')): ?><div class="remind" >
					  <div class="td1">
							<div class="checkbox J_remind"><input name="sms_remind" type="hidden" value="0"></div>
					  </div>
					  <div class="td2">收到答案时短信通知我<span class="J_user_edit_mobile"><?php echo ($user["mobile"]); ?>[更改]</span></div>
					  <div class="td3">
					 <?php if(C("UU_GOLD_SEND_MB") > 0 ): ?>-<?php echo (C("UU_GOLD_SEND_MB")); endif; ?>
					  </div>
					  <div class="clear"></div>
					  
			</div><?php endif; ?>

<?php if($_SESSION['uu']['uid']!= ''): ?><div class="reward">
			  <div class="td1">
			    <div class="checkbox J_reward_open"><input name="reward_open" type="hidden" value="0"></div>
			  </div>
			  <div class="td2">答题悬赏</div>
			  <div class="td3">
			    <div class="sel">
					  <div class="v J_reward_sel">-5</div>
					  <input name="reward" id="J_reward_input" type="hidden" value="5">
					  <div class="showreward J_reward_menu">
						  <ul>
						  <li title="-5" id="5">-5</li>
						  <li title="-10" id="10">-10</li>
						  <li title="-30" id="30">-30</li>
						  <li title="-50" id="50">-50</li>
						  <li title="-100" id="100">-100</li>
						  <li title="-200" id="200">-200</li>
						  </ul>
					  </div>
			    </div>
				
			  </div>
			  <div class="td4">你目前的财富值为 <strong id="J_user_gold"><?php echo ($user["gold"]); ?></strong></div>
			  <div class="clear"></div>
    </div><?php endif; ?> 

<?php if($_SESSION['uu']['uid']== ''): ?><div class="mb">
	   <div class="mbmain"> 
	     <input type="text" class="mbiput" maxlength="11" onKeyUp="if(event.keyCode !=37 && event.keyCode != 39) value=value.replace(/\D/g,'');"onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\D/g,''))"  placeholder="输入手机号"  name="mobile" >
	     
	     <input type="text" class="mbiput code" maxlength="11" onKeyUp="if(event.keyCode !=37 && event.keyCode != 39) value=value.replace(/\D/g,'');"onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/\D/g,''))" placeholder="输入验证码"  name="code">
		 <div class="mbiput btn J_send_code">获取验证码</div>
        </div>
	 </div><?php endif; ?> 
	 
     <div class="btns">
	   <div class="td1">
	   <input name="" type="button" id="J_add" value="提交问题" class="btn"> 
	   </div>
	   
	   <?php if($_SESSION['uu']['uid']!= ''): ?><div class="td2"><div class="checkbox J_anonymous_open"><input name="anonymous" type="hidden" value="0"></div></div>
		   <div class="td3">匿名提问</div>
		   <?php if(C("UU_GOLD_QUANTIFIER_ANONYMOUS") > 0 ): ?><div class="td4">-<?php echo (C("UU_GOLD_QUANTIFIER_ANONYMOUS")); ?></div><?php endif; endif; ?> 
	   
	   <div class="clear"></div>
    </div>
    </form>
	 
  </div>
  
  
  <!--右侧开始 -->
  
   <div class="addr">
   
   
     <div class="help">
	   <div class="tit">如何能获得快速准确的回答？</div>
	   <div class="td1">1</div>
	   <div class="td2">问题标题描述准确；</div>
	   <div class="clear"></div>
	    <div class="td1">2</div>
	   <div class="td2">选择正确发分类和标签；</div>
	   <div class="clear"></div>
	    <div class="td1">3</div>
	   <div class="td2">如果标题描述不清，可使用详细内容继续描述；</div>
	   <div class="clear"></div>
	    <div class="td1">4</div>
	   <div class="td2">适当的增加悬赏会吸引更多用户回答；</div>
	   <div class="clear"></div>
     </div>
	 
	 
	 
	 
	 
	 
   </div>
   
   
   <div class="clear"></div>
</div>
<div class="footernav link_gray6">
<a href="<?php echo C('UU_SITE_DOMAIN');?>/">首页</a>
<?php $tag_intro_class = new \Common\Taglib\intro();$li = $tag_intro_class->run(array('listname'=>'li','cache'=>'0',)); ?>
<?php if(is_array($li["list"])): $i = 0; $__LIST__ = $li["list"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$li): $mod = ($i % 2 );++$i;?><span>|</span><a href="<?php echo ($li["url"]); ?>" target="_blank"><?php echo ($li["title"]); ?></a><?php endforeach; endif; else: echo "" ;endif; ?>
</div>  
<div class="footertxt link_gray3">
<a href="http://www.miibeian.gov.cn/" target="_blank"><?php echo C('UU_ICP');?></a>
Powered By <a href="http://www.zgxmall.com" target="_blank"><span class="by">中港星企业服务论坛</span><span class="version"><?php echo C('UU_VERSION');?></span></a>
<?php echo C('UU_COPYRIGHT');?>
<br />
联系地址：深圳市罗湖区人民南路国贸大厦17、19楼&nbsp;&nbsp;&nbsp;&nbsp;联系电话：0755-82211688
 
<div class="statistics"><?php echo C('UU_STATISTICS');?></div>
</div>

<!--未登录发布问题 -->
<script type="text/javascript">
/********
/#####
/#####  验证表单和计算金币
/#####
*/
var send_val      =Number("<?php echo (C("UU_GOLD_SEND_MB")); ?>");//收到答案时短信通知 所需积分
var anonymous_gold=Number("<?php echo (C("UU_GOLD_QUANTIFIER_ANONYMOUS")); ?>");//匿名所需积分
var user_gold     =Number("<?php echo ((isset($user["gold"]) && ($user["gold"] !== ""))?($user["gold"]):"0"); ?>");//会员目前拥有的积分，未登录为0
$(document).ready(function()
{
        //提交问题  
        $("#J_add").click(function(){
			$(this).val('正在提交......').attr("disabled","disabled");
            title=$('input[name=title]').val();
			if (title==''){
				disapperTooltip("remind", "请填写问题标题");
				$(this).val('提交问题').removeAttr("disabled");
				 return false;
			}
			else if (title.length < 5) {
          		 disapperTooltip("remind", "您的提问标题过短，请将问题说明清楚！");
				 $(this).val('提交问题').removeAttr("disabled");
           		 return false;
        	}
			category1=$('input[name=category1]').val();
			if (category1=='' || category1=='0'){
				disapperTooltip("remind", "请选择问题分类！");
				$(this).val('提交问题').removeAttr("disabled");
				 return false;
			}
			<?php if($_SESSION['uu']['uid']== ''): ?>code=$('input[name=code]').val();
			if (code==''){
				disapperTooltip("remind", "请填写短信验证码！");
				$(this).val('提交问题').removeAttr("disabled");
				 return false;
			}else{
					$.getJSON(ajaxURL, { act: "ajax_mobile_code_verify",code:code}, function(json){
						if (json.status==0){
							disapperTooltip("remind",json.content);
							$("#J_add").val('提交问题').removeAttr("disabled");
							return false;
						}else if (json.status==1){
							$("form[name=add]").submit();
						}else{
							disapperTooltip("remind","未知错误");
							$("#J_add").val('提交问题').removeAttr("disabled");
							return false;
						}
					});
			}
			<?php else: ?>
			$("form[name=add]").submit();<?php endif; ?>
			
        });
		
		
		//发送验证码
		$('.J_send_code').live('click',function() {
					btn=$(this);
					if (btn.hasClass('btn_disabled')) return false;
					function settime(countdown) {
						if (countdown == 0) {
							btn.removeClass('btn_disabled');
							btn.text('获取验证码');
							countdown = <?php echo C('UU_SMS_SETTIME');?>;
							return;
						} else {
							btn.addClass('btn_disabled');
							btn.text('重新发送' + countdown + '秒');
							countdown--;
						}
						setTimeout(function() {
							settime(countdown)
						},1000)
					}
					var mobile=$('input[name=mobile]').val();
					if (mobile.length==''){
						disapperTooltip("remind",'请填写手机号');
						return false;
					}
					if (mobile.length!=11){
						disapperTooltip("remind",'请填写正确的手机号');
						return false;
					}
					btn.addClass('btn_disabled').html('正在发送中.');
					$.getJSON(ajaxURL, { act:"ajax_send_mobile_code",mobile:mobile,in_user:0}, function(json){
						if (json.status==0){
							btn.removeClass('btn_disabled').html('获取验证码');
							disapperTooltip("remind",json.content);
						}else if (json.status==1){
							disapperTooltip("success",json.content);
							settime(<?php echo C('UU_SMS_SETTIME');?>);
						}else{
							btn.removeClass('btn_disabled').html('获取验证码');
							disapperTooltip("remind",json.content);
						}
					});
		});
		//开启收到答案时短信通知项
		$('.J_remind').click(function()
		{
			checkedinput=$(this).find("input");
			v=checkedinput.val();
			if (v=='0'){
				if (user_gold<send_val){
				disapperTooltip("remind","你的<?php echo C('UU_GOLD_BYNAME');?>不够用了，平时多攒点呀～");
				return false;
				}
				checkedinput.val(1);
				$(this).addClass('select');
				user_gold=user_gold-send_val;
				$("#J_user_gold").text(user_gold);
			}else{
				checkedinput.val(0);
				$(this).removeClass('select');
				user_gold=user_gold+send_val;
				$("#J_user_gold").text(user_gold);
			}
		});
		//
		//开启答题悬赏
		$('.J_reward_open').click(function()
		{
			reward_val=Number($('input[name=reward]').val());
			checkedinput=$(this).find("input");
			v=checkedinput.val();
			if (v=='0'){
				if (user_gold<reward_val){
				disapperTooltip("remind","你的<?php echo C('UU_GOLD_BYNAME');?>不够用了，平时多攒点呀～");
				return false;
				}
				checkedinput.val(1);
				$(this).addClass('select');
				user_gold=user_gold-reward_val;
				$("#J_user_gold").text(user_gold);				
			}else{
				checkedinput.val(0);
				$(this).removeClass('select');
				user_gold=user_gold+reward_val;
				$("#J_user_gold").text(user_gold);	
			}
		});
		//开启匿名
		$('.J_anonymous_open').click(function()
		{
			checkedinput=$(this).find("input");
			v=checkedinput.val();
			if (v=='0'){
				if (user_gold<anonymous_gold){
				disapperTooltip("remind","你的<?php echo C('UU_GOLD_BYNAME');?>不够用了，平时多攒点呀～");
				return false;
				}
				checkedinput.val(1);
				$(this).addClass('select');
				user_gold=user_gold-anonymous_gold;
				$("#J_user_gold").text(user_gold);				
			}else{
				checkedinput.val(0);
				$(this).removeClass('select');
				user_gold=user_gold+anonymous_gold;
				$("#J_user_gold").text(user_gold);	
			}
		});
	
});
</script>
<script type="text/javascript">
	var uploadUrl = "<?php echo RU('Upload/img');?>";
</script>
<script src="/<?php echo C('UU_TPL_DIR');?>/public/js/ajaxfileupload.js"></script>
<script src="/<?php echo C('UU_TPL_DIR');?>/public/js/fileupload.js"></script>
<script type="text/javascript">
/********
/#####
/#####  图片相关
/#####
*/
$(document).ready(function()
{
var IMGindex=1;
var IMGnum=3;//允许上传数量
var TAGnum=3;//允许TAG添加数量
// 上传图标
$.upload('#J_upload_btn',{type:'question_img'},function(result){
		if(result.status == 1){;
			html=htmlSTR(IMGindex);
			if ($(".uploadimgbox .imgbox").length>=IMGnum){
				disapperTooltip("remind","最多只能上传"+IMGnum+"张图片");
				return false;
			}
			var imgobj=".uploadimgbox .imgs"+(Number(IMGindex)-1);
			$(".uploadimgbox").prepend(html).show();
			$(imgobj).find('a').attr('href',result.content.src);
			$(imgobj).find('img').attr('src',result.content.src);
			$(imgobj).find('input').val(result.content.savename);
		} else {
			disapperTooltip("remind", "上传失败："+result.content);
		}
		//生成html
		function htmlSTR(index){
			html="";  
			html+="<div class=\"imgbox imgs"+index+"\">";
			html+="<a href=\"#\" target=\"_blank\"><input name=\"img[]\" type=\"hidden\" value=\"#\"><img src=\"#\" border=\"0\" /></a>";
			html+="<div class=\"del J_img_del\">删除</div>";
			html+="</div>";
			IMGindex=index+1;
			return html;
		}
		
	});
	//删除上传图片
	$('.J_img_del').live('click',function() {
	 	$(this).parent(".imgbox").remove();
		if ($(".uploadimgbox .imgbox").length==0) $(".uploadimgbox").hide();
	});
	//修改手机
		$('.J_user_edit_mobile').live('click',function() {
		 var UUDialog = $(this).dialog({
		        title: false,
        		loading: true,
				footer: false,
				header: false,
				border: false,
				backdrop: false
		});
		 $.getJSON(ajaxURL, { act: "ajax_edit_mobile"}, function(json){
					if (json.status==0){
						UUDialog.hide();
						disapperTooltip("remind", json.content);
					}else if (json.status==1){
						UUDialog.hide();
						var MDialog = $(this).dialog({
								title: "修改手机号",
								content:json.content,
								footer: true,
								header: true,
								border: true,
								innerPadding: true,
								backdrop: true,
						 		yes: function() {
									
									mobile=$("input[name='mobile']").val();
									code=$("input[name='code']").val();
								$.getJSON(ajaxURL, { act: "ajax_edit_mobile",mobile:mobile,code:code,edit:"1"}, function(json){
										if (json.status==0){
											disapperTooltip("remind", json.content);
										}else if (json.status==1){
 											disapperTooltip("success",json.content);
											$('.J_user_edit_mobile').text(json.mobile+'[修改]');
											$('.modal').remove();
											$('.modal_backdrop').remove();
										}else{
											disapperTooltip("remind","修改失败，未知错误");
										}
								});	
							}
						});
						MDialog.setCloseDialog(false);
					}else{
						UUDialog.hide();
						disapperTooltip("remind","未知错误");
					}
		});
	});
	
	

});
</script>
<script type="text/javascript">
$(document).ready(function()
{
/********
/#####
/#####  下拉，分类和悬赏选择
/#####
*/

//一二级分类切换
	<?php if(C('UU_CAT_LEVEL_QUESTION') == '1'): ?>ShowMenu('.J_cat_menu','#J_category1','.J_cat_menu','.J_cat_show_menu');
	<?php else: ?>
	//二级分类
	$('.J_cat_menu').live('click',function() {
		 var UUDialog = $(this).dialog({
		        title: false,
        		loading: true,
				footer: false,
				header: false,
				border: false,
				backdrop: false
		});
		 $.getJSON(ajaxURL, { act: "ajax_cat_list",type:1}, function(json){
					if (json.status==0){
						UUDialog.hide();
						disapperTooltip("remind", json.content);
					}else if (json.status==1){
						UUDialog.hide();
						var MDialog = $(this).dialog({
								title: "请选择分类",
								content:json.content,
								footer: true,
								header: true,
								border: true,
								innerPadding: true,
								backdrop: true,
						 		yes: function() {
									cbtn=$(".ajax_cat_list span.select");
									ctit=cbtn.attr('title');
									category1=cbtn.attr('category1');
									category2=cbtn.attr('category2');
									if (ctit!='')
									{
										$('.J_cat_menu').text(ctit);
										$('#J_category1').val(category1);
										$('#J_category2').val(category2);
										$('.modal').remove();
										$('.modal_backdrop').remove();
									}
								 
							}
						});
						MDialog.setCloseDialog(false);
					}else{
						UUDialog.hide();
						disapperTooltip("remind","未知错误");
					}
		});
	});<?php endif; ?>
	//悬赏金币选择
	ShowMenu('.J_reward_sel','#J_reward_input','.J_reward_sel','.J_reward_menu');
});
</script>
<script type="text/javascript">
$(document).ready(function()
{
/********
/#####
/#####  TAG相关
/#####
*/
//打开添加标签页JS操作 (ajax_tag_list.html页面操作)
TAGnum=3;//允许TAG添加数量

//打开标签弹窗
$('#J_addtag').live('click',function() {
		 var UUDialog = $(this).dialog({
		        title: false,
        		loading: true,
				footer: false,
				header: false,
				border: false,
				backdrop: false
		});
		
		tags=$(".showtag .tag");
		tags_str='';
		if (tags.length>0)
		{
			tags_arr=new Array();
			tags.each(function(i){
			tags_arr[i]=$(this).attr('title');
			});
			tags_str=tags_arr.join("__uuask__");
		}
		 $.getJSON(ajaxURL, { act: "ajax_tag_list",tags:tags_str}, function(json){
					if (json.status==0){
						UUDialog.hide();
						disapperTooltip("remind", json.content);
					}else if (json.status==1){
						UUDialog.hide();
						var MDialog = $(this).dialog({
								title: "请选择标签",
								content:json.content,
								footer: true,
								header: true,
								border: true,
								innerPadding: true,
								backdrop: true,
						 		yes: function() {
									tags=$(".ajax_tag_list .tagli.select");
									if (tags.length>0)
									{
										html='';
										tags.each(function(i){
										html+='<div class="tag" title="'+$(this).attr('title')+'">'+$(this).attr('title')+'<input name="tag[]" type="hidden" value="'+$(this).attr('title')+'"></div>';
										});
										$('.showtag .tag').remove();
										$('.showtag').prepend(html).show();
										unm=TAGnum-tags.length;
										$('.showtag .tip span').html(unm);
									}
								 
							}
						});
					}else{
						UUDialog.hide();
						disapperTooltip("remind","未知错误");
					}
		});
	});
//从窗口选择标签
$('.ajax_tag_list .tagli').live('click',function()
{
	if ($(this).hasClass('select')){
	$(this).removeClass('select');
	}else{
	$(this).addClass('select');
	}
	if ($(".ajax_tag_list .tagli.select").length>TAGnum){
	disapperTooltip("remind","最多只能选择"+TAGnum+"个标签");
	$(this).removeClass('select');
	}
});
//搜索标签
$('.J_sotag_btn').live('click',function()
{
	btn=$(this);
	btn.attr("disabled","disabled").addClass('btn_disabled');
	tagkey=$('#J_tagkey').val();
	if (tagkey.length==0)
	{
		disapperTooltip("remind","请填写关键字！");
		btn.removeAttr("disabled").removeClass('btn_disabled');
		return false;
	}
	$.getJSON(ajaxURL,{act: "ajax_tag_so",tagkey:tagkey}, function(json){
					
					if (json.status==0)
					{
						disapperTooltip("remind", json.content);
						btn.removeAttr("disabled").removeClass('btn_disabled');
					}
					else if (json.status==1)
					{
							if (json.count==0)
							{
								$('.ajax_tag_list .soshow').hide();
								$('.ajax_tag_list .soempty').show();
								$(".ajax_tag_list .soempty strong").html(json.key);
								$(".ajax_tag_list .soempty .J_add_tag_key").attr('title',json.key);
							}
							else
							{
								$('.ajax_tag_list .soshow').show();
								$('.ajax_tag_list .soempty').hide();
								tag=json.content;
								htm='';
								for(var i in tag)
								{
								htm+="<div class=\"tagli\" title=\""+tag[i].tag+"\">"+tag[i].tag+"</div>";
								}
								htm+="<div class=\"clear\"></div>";
								$(".ajax_tag_list .soshow .stxt").html(htm);
							}
							btn.removeAttr("disabled").removeClass('btn_disabled');
					}else{
						disapperTooltip("remind","未知错误");
						//
						btn.removeAttr("disabled").removeClass('btn_disabled');
						//
					}
	});

});
//从搜索结果添加标签
$('.J_add_tag_key').live('click',function()
{
	tag=$(this).attr('title');
	if ($(".ajax_tag_list .tagli[title='"+tag+"']").length>0)
	{
	disapperTooltip("remind",tag+"已存在，不能重复添加标签");
	return false;
	}
	else
	{
		if ($(".ajax_tag_list .tagli.select").length>=TAGnum){
		html="<div class=\"tagli\" title="+tag+">"+tag+"</div>";
		$(".ajax_tag_list .tlist .clear").before(html);
		}
		else
		{
		html="<div class=\"tagli select\" title="+tag+">"+tag+"</div>";
		$(".ajax_tag_list .tlist .clear").before(html);
		}		
	}
});
//删除所选标签
$('.showtag .tag').live('click',function()
{
	$(this).remove();
	tags=$('.showtag .tag');
	if (tags.length==0)
	{
	$('.showtag').hide();
	}
	unm=TAGnum-tags.length;
	$('.showtag .tip span').html(unm);
});
	
});
</script>
</body>
</html>